import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const state = {
  photoList: []
};

const mutations = {
  setPhotoList(state, status) { //status为改变state的值 
    state.photoList = status; 
  }
};

// 相当于computed
const getters = {

};

const actions = { //异步指: 判断,请求后,再调用mutations
  setPhotoList({commit}, status) {
    commit('setPhotoList', status);
  }
};

export default new Vuex.Store({
  state,
  getters,
  mutations,
  actions
});
